package cc.recent.normal.information.multi_engine;

import java.util.HashMap;
import java.util.Map;

public class Messages {

    public static class CommonParams {
        public String getMethod() {
            return method;
        }

        public void setMethod(String method) {
            this.method = method;
        }

        public String getUniqueId() {
            return uniqueId;
        }

        public void setUniqueId(String uniqueId) {
            this.uniqueId = uniqueId;
        }

        public Map<String, Object> getArguments() {
            return arguments;
        }

        public void setArguments(Map<String, Object> arguments) {
            this.arguments = arguments;
        }

        private String method;
        private String uniqueId;
        private Map<String, Object> arguments;

        Map<String, Object> toMap() {
            Map<String, Object> toMapResult = new HashMap<>();
            toMapResult.put("method", method);
            toMapResult.put("uniqueId", uniqueId);
            toMapResult.put("arguments", arguments);
            return toMapResult;
        }

        static CommonParams fromMap(Map<String, Object> map) {
            CommonParams fromMapResult = new CommonParams();
            Object method = map.get("method");
            fromMapResult.method = (String)method;
            Object uniqueId = map.get("uniqueId");
            fromMapResult.uniqueId = (String)uniqueId;
            Object arguments = map.get("arguments");
            fromMapResult.arguments = (Map<String, Object>) arguments;
            return fromMapResult;
        }

    }
}
